package Main;

import Corpus.*;
import Tagger.*;
import java.io.*;


public class Main {

	public static void main2(String[] args) {

		Corpus corpus=new WikiCorpus("files\\file",".xml",1,1,"allText\\","allMetadata\\","out\\allAtricles.txt","allHtml\\");//23018
		Tagger tagger=new MalletTagger("out\\","keys.txt","topics.txt","data.mallet","C:\\Users\\admin\\Downloads\\mallet-2.0.6\\",20,5,15);

		Active.active(corpus, tagger, Consts.SOLR_URL);
	}

	public static void main(String[] args) {

		/*try {
                        InputStreamReader isr = new InputStreamReader(System.in);
                        BufferedReader br = new BufferedReader(isr);
                        System.out.println("Please enter the server port");
                        String serverPort = br.readLine();
                        System.out.println("Please enter the solr port");
                        String solrPort = br.readLine();

                Consts.SERVER_URI="http://"+GetMyIp.getMyIp()+":"+serverPort;
                Consts.SOLR_URL="http://localhost:"+solrPort+"/solr/";
                } catch (IOException e) {
                        e.printStackTrace();
                }*/

		Consts.SERVER_PORT=Integer.parseInt(args[0]);
		Consts.SERVER_URI="http://"+GetMyIp.getMyIp()+":"+args[0];
		Consts.SOLR_URL="http://localhost:"+args[1]+"/solr/";

		String corpusPath;

		if(args.length==3){
			corpusPath = args[2];
		}
		else{
			corpusPath = "demoCorpus";
		}

		Corpus corpus=new DemoCorpus(corpusPath);
		Tagger tagger=new DemoTagger();

		Active.active(corpus, tagger, Consts.SOLR_URL);
	}

}
